home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
math
/
newmat08
/
boolean.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-11
|
1KB
|
54 lines
//$$ boolean.h Boolean class
#ifndef Boolean_LIB
#define Boolean_LIB 0
/*class BooleanTRUE
{
public:
BooleanTRUE() {}
operator int() const { return 1; }
int operator! () const { return 0; }
FREE_CHECK(BooleanTRUE);
};
class BooleanFALSE
{
public:
BooleanFALSE() {}
operator int() const { return 0; }
int operator! () const { return 1; }
FREE_CHECK(BooleanFALSE);
};
const BooleanTRUE TRUE;
const BooleanFALSE FALSE;
*/
class Boolean
{
int value;
public:
Boolean(const int b) { value = b ? 1 : 0; }
Boolean(const void* b) { value = b ? 1 : 0; }
Boolean() {}
// Boolean(const BooleanTRUE) : value(1) {}
// Boolean(const BooleanFALSE) : value(0) {}
operator int() const { return value; }
int operator!() const { return !value; }
// void operator=(const BooleanTRUE) { value=1; }
// void operator=(const BooleanFALSE) { value=0; }
FREE_CHECK(Boolean);
};
const Boolean TRUE = 1;
const Boolean FALSE = 0;
// version for some older versions of gnu g++
//#define FALSE 0
//#define TRUE 1
#endif